#ifndef _NAVIGATE_H_ 
#define _NAVIGATE_H_

#ifndef _POINT_
#define _POINT_
struct point {float x; float y;};
typedef struct point Point;
#endif

//Switches which direction the robot believes is front
void switchFrontDir();

//returns 0 or 1, 1 means the structual front is also the 
//navigational front
uint8_t getFront();

//sets color at begining of match in umain
void setMyColor(uint8_t color);

//returns 0 or 1, 1 is Blue 0 is Red (hack)
uint8_t getMyColor();

//calls copy_objects() to update heading, positon and 
//get new game data regarding remaining sheep, territory owners
void getData();

//the robot position, calls getData() first
Point getMyPosition();

//the opponent robot position, calls getData() first
Point getOpponentPosition();

//the structual front of the robot's heading, calls getData() first
float getMyHeading();

//the owner of any territory, returns team #
int getTerritoryOwner(uint8_t territory);


//the amount of sheeps left to mine
int getTerritorySheepLeft(uint8_t territory);

//time left before we can mine again
int getTerritorySheepTimeLeft(uint8_t territory);

//the currentGoal (or previous goal if no new goal has been set)
Point getCurrentGoal();

//finds the distance between two points
float calculateDistance(Point goal, Point start);

//makes input goal the current goal
void setNextGoal(Point goal);

//turns input degrees efficiently-- will not turn more than 90˚, 
//may switch the navigational front of the robot
void turnDegrees(float deg, uint16_t speed );

//turns to the input heading, structual front of robot will 
//end at the goal heading
void turnToHeading(int16_t goalHeading);

//will drive x feet navigationally forward
//BEWARE: if you have recently used driveToPoint,
//navigational front may not be same as structural front
void driveFeet(float feet, uint16_t speed, float accuracy);

//drives x feet forward from the structural front
void driveForwardFeet(float feet, int16_t speed);

//turns towards a given point
void turnToPoint(Point goal);

//drives to a given point, turns then drives
void driveToPoint(Point goal, float accuracy);

#endif